xl: Return an error if an empty file is passed to cd-insert
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Tue, 14 May 2013 10:07:14 +0000 (11:07 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 30 May 2013 08:10:51 +0000 (09:10 +0100)
commit121dac93afd2f600485618d9b493892e2fca8fa8
treeda81e7c5fcb1910ee15c55accb47efefeb94e016
parent1ecd5e015d67837bb094e9e8921dca4e90578f8a
xl: Return an error if an empty file is passed to cd-insert

Two changes:
* Stat the file before calling libxl_cdrom_insert()
* Return an error if anything fails (including libxl_cdrom_insert)

This is in part to work around the fact that the RAW disk type
is used for things that aren't actually files; so we can't call
stat in libxl_device.c:libxl__device_disk_set_backend() because
it may be going over a remote protocol.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c